package com.skyline.myspider.schedule;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

public class LinkedSiteList implements SiteList {
	private List<WebSite> sites;

	public LinkedSiteList() {
		sites = new LinkedList<WebSite>();
	}

	public boolean isVisited(String url) {
		return false;
	}

	public void addVisitedSite(String siteUrl) {
		WebSite e = new WebSite();
		e.setAddTime(new Date());
		e.setName(siteUrl);
		sites.add(e);
	}

	public UrlList getSubUrls(String siteUrl) {
		for (int i = 0; i < sites.size(); i++) {
			if (sites.get(i).getName().equals(siteUrl)) {
				return sites.get(i).getSubUrls();
			}
		}
		return null;
		// return sites;
	}
}
